const Router = require('koa-router');
const {db, Op,QueryTypes } = require("../../models/db");
const { xe, getTime} = require("../../tools/tool");
const router = new Router();

// 意见反馈
router.post('/zd/yj', async ctx => {
    let usr = ctx.user
    let tenantId = usr.tenantId;
    let val = ctx.request.body.val?xe.trim(ctx.request.body.val):'';
    if(val) {
        let models = db.models['zAdv'].build()
        models.tenantId = tenantId;
        models.uid = usr.id;
        models.content = val;
        models.ctime = getTime()
        await models.save()
        return ctx.suc('提交成功')
    }
   return ctx.suc('')
})

module.exports = router;
